package com.ws.wuse.app;

import com.ws.base.hawk.Hawk;
import com.ws.base.hawk.HawkBuilder;
import com.ws.base.hawk.LogLevel;
import com.ws.base.util.CrashUtil;
import com.ws.base.util.LogUtil;

/**
 * User: zhanghang
 * Date: 2016-03-01
 * Time: 14:31
 * FIXME
 */
public class Application extends android.app.Application {

    @Override
    public void onCreate() {
        super.onCreate();

        // 设置错误日志收集保存
        CrashUtil catchExcep = new CrashUtil(getApplicationContext());
        Thread.setDefaultUncaughtExceptionHandler(catchExcep);

        // 设置错误日志打印显示
        LogUtil.isLogEnable = Constant.DEBUG;

        //初始化缓存框架
        Hawk.init(this)
                .setEncryptionMethod(HawkBuilder.EncryptionMethod.MEDIUM)
                .setStorage(HawkBuilder.newSqliteStorage(this))
                .setLogLevel(LogLevel.FULL)
                .build();
    }
}
